Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Platform.IsMono with actual OS checks #356

Merged
merged 5 commits into from
Nov 7, 2024
Merged

Conversation

rmunn
Copy link
Contributor

@rmunn rmunn commented Oct 29, 2024

Fix #355.

Some cases of Platform.IsMono are workarounds for bugs in older versions of mono. Those can probably be removed, but for safety's sake, we'll leave them alone for now.

Other cases are clearly trying to check the platform, to run Linux-only or Windows-only code. Those cases should be replaced by Platform.IsUnix or Platform.IsWindows as appropriate, because nearly everywhere that Chorus is being run on Linux these days, it's running under dotnet rather than mono, and the Platform.IsMono check returns false.


This change is Reviewable

Some cases of Platform.IsMono are workarounds for bugs in older versions
of mono. Those can probably be removed, but for safety's sake, we'll
leave them alone for now.

Other cases are clearly trying to check the platform, to run Linux-only
or Windows-only code. Those cases should be replaced by Platform.IsUnix
or Platform.IsWindows as appropriate, because nearly everywhere that
Chorus is being run on Linux these days, it's running under dotnet
rather than mono, and the Platform.IsMono check returns false.
@rmunn rmunn self-assigned this Oct 29, 2024
@rmunn rmunn requested a review from hahn-kev October 29, 2024 08:57
@rmunn
Copy link
Contributor Author

rmunn commented Oct 29, 2024

@hahn-kev - This bug is "in the wild" in LfMerge. If LfMerge ever encounters a merge conflict between two .txt files, it will try to run Windows-only code and promptly error out, resulting in a Mercurial rollback because the merge conflict wasn't handled. Thankfully it's extremely unlikely that anyone will check .txt files into their FieldWorks project, let alone end up with a merge conflict in those files. However, I want to prioritize reviewing and merging this bugfix so that I can push a new LfMerge release that won't try to run Windows-only code.

Copy link

github-actions bot commented Oct 29, 2024

Test Results

       4 files  ±0     412 suites  ±0   2h 45m 51s ⏱️ +5s
   883 tests ±0     860 ✔️ ±0    23 💤 ±0  0 ±0 
4 040 runs  ±0  3 906 ✔️ ±0  134 💤 ±0  0 ±0 

Results for commit 4932740. ± Comparison against base commit a6a7041.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I'd rather not make any changes to RunProcess though, see comments

@rmunn rmunn requested a review from hahn-kev November 5, 2024 08:42
@rmunn rmunn merged commit 51bb8f8 into master Nov 7, 2024
5 checks passed
@rmunn rmunn deleted the bugfix/platform-ismono branch November 7, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix occurrences of Platform.IsMono
2 participants